#include<stdio.h>
#include<malloc.h>
struct node
{int data;
struct node * next;
};

void create(struct node *m)
{struct node *x,*y;
int i,j;
printf("input number(j):\n");
scanf("%d",&j);
y=m;
for(i=1;i<=j;i++)
{x=(struct node *)malloc(sizeof(struct node));
scanf("%d",&x->data);
y->next=x;
y=y->next;}
}

main()
{
struct node *l,*p;
l=(struct node *)malloc(sizeof(struct node));
create(l);
p=l->next;
while(p!=NULL)
{
	printf("%d ",p->data);
	p=p->next;
}
}
